import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import pandas as pd

df = pd.read_csv("results/tot_tweets_metoo.csv")
df["year_month"] = pd.to_datetime(df["year_month"])

fig, ax = plt.subplots(figsize=(10, 6))
ax.plot(df['year_month'], df['tweets']/1000000, marker='o', c='blue')
ax.xaxis.set_major_locator(mdates.MonthLocator(interval=2))
ax.xaxis.set_major_formatter(mdates.DateFormatter("%m/%y"))
# ax.set_xlim(left=df['year_month'][0])
plt.setp(ax.get_xticklabels(), rotation=45, ha="right")
plt.ylabel('Millions of Tweets After Preprocessing')
plt.tight_layout()
plt.savefig("results/metoo_tweets_over_time.png")